package repository;


import com.xgggh.redpack.BuildConfig;
import com.xgggh.redpack.domain.auth.Auth;
import com.xgggh.redpack.domain.auth.AuthReq;
import com.xgggh.redpack.domain.redpack.Pack;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Flowable;
import io.reactivex.subscribers.DisposableSubscriber;
import model.Rsp;
import model.Status;
import retrofit2.Retrofit;
import retrofit2.mock.MockRetrofit;
import service.OauthService;
import service.RedPackService;


public class OauthRepository extends BaseRepository{

    @Inject
    public OauthRepository(Retrofit retrofit, MockRetrofit mockRetrofit) {
        this.retrofit = retrofit;
        this.mockRetrofit = mockRetrofit;
    }

    public Flowable<Rsp<Auth>> token(AuthReq authReq) {
        return retrofit.create(OauthService.class)
                .token(authReq)
                .compose(ioTransformer());
    }

    public Flowable<Rsp> logout() {
        return retrofit.create(OauthService.class)
                .logout()
                .compose(ioTransformer());
    }


}
